# coding=UTF-8
'''
Created on 2018年4月23日

@author: lijie
'''
from businessLayer.page_element.common_element.navigation import Navigation
from businessLayer.page_element.metadata.metadata_add_collection_pop_page import MetaAddCollectionPopPage
from businessLayer.page_element.metadata.metadata_collection_page import MetaCollectionPage
from businessLayer.page_element.metadata.metadata_left_menu import  MetaMenu
from businessLayer.utilites.gvcommon import Common

class MetaDataHelper():
        
    def goto_collection_page(self):
        '''进入元数据采集主页面
        '''
        Navigation().LnkMetadataManage().wait_present_and_click()
        MetaMenu().LnkCollection().click()
        MetaCollectionPage().BtnAddCollection().wait_element_present()
        
    def goto_add_collection_pop_page(self):
        '''进入新增采集弹出页面
        '''
        self.goto_collection_page()
        MetaCollectionPage().BtnAddCollection().click()
        MetaAddCollectionPopPage().TxtCollectionTaskNAME().wait_element_present()
        
    def goto_edit_collection_pop_page(self,coll_name):
        '''进入采集编辑弹出页面
        '''
        self.goto_collection_page()
        MetaCollectionPage().LblCollTitleByName(coll_name).mouse_hover()
        Common().wait_sleep(1)
        MetaCollectionPage().BtnEditByTitle(coll_name).click()
        MetaAddCollectionPopPage().BtnSubmit().wait_element_present()
